curl --request POST \
--url https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_keys": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"install_management_key": true,
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
],
"one_click_apps": [
{
"slug": "<string>",
"parameters": {}
}
],
"control_panel": "<string>",
"addon_ids": [
"<string>"
],
"accepted_contract_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview"
payload = {
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_keys": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"install_management_key": True,
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": ["<string>"],
"one_click_apps": [
{
"slug": "<string>",
"parameters": {}
}
],
"control_panel": "<string>",
"addon_ids": ["<string>"],
"accepted_contract_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
size_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
image_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '',
volume_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ssh_keys: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
install_management_key: true,
vpc_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tags: ['<string>'],
one_click_apps: [{slug: '<string>', parameters: {}}],
control_panel: '<string>',
addon_ids: ['<string>'],
accepted_contract_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'size_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'image_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '',
'volume_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ssh_keys' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'install_management_key' => true,
'vpc_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tags' => [
'<string>'
],
'one_click_apps' => [
[
'slug' => '<string>',
'parameters' => [
]
]
],
'control_panel' => '<string>',
'addon_ids' => [
'<string>'
],
'accepted_contract_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview"
payload := strings.NewReader("{\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_keys\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"install_management_key\": true,\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"one_click_apps\": [\n {\n \"slug\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"control_panel\": \"<string>\",\n \"addon_ids\": [\n \"<string>\"\n ],\n \"accepted_contract_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_keys\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"install_management_key\": true,\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"one_click_apps\": [\n {\n \"slug\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"control_panel\": \"<string>\",\n \"addon_ids\": [\n \"<string>\"\n ],\n \"accepted_contract_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_keys\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"install_management_key\": true,\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"one_click_apps\": [\n {\n \"slug\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"control_panel\": \"<string>\",\n \"addon_ids\": [\n \"<string>\"\n ],\n \"accepted_contract_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body[Instances] Preview what ordering an instance costs
Price the configuration the customer is about to order: totals, VAT, the account credit that would be applied and the amount left to pay, plus the contracts still to be accepted, add-ons included.
curl --request POST \
--url https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_keys": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"install_management_key": true,
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": [
"<string>"
],
"one_click_apps": [
{
"slug": "<string>",
"parameters": {}
}
],
"control_panel": "<string>",
"addon_ids": [
"<string>"
],
"accepted_contract_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview"
payload = {
"size_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"location_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"image_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "",
"volume_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ssh_keys": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"],
"install_management_key": True,
"vpc_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tags": ["<string>"],
"one_click_apps": [
{
"slug": "<string>",
"parameters": {}
}
],
"control_panel": "<string>",
"addon_ids": ["<string>"],
"accepted_contract_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
size_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
location_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
image_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '',
volume_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ssh_keys: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
install_management_key: true,
vpc_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
project_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tags: ['<string>'],
one_click_apps: [{slug: '<string>', parameters: {}}],
control_panel: '<string>',
addon_ids: ['<string>'],
accepted_contract_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']
})
};
fetch('https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'size_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'location_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'image_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '',
'volume_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ssh_keys' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'install_management_key' => true,
'vpc_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'project_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tags' => [
'<string>'
],
'one_click_apps' => [
[
'slug' => '<string>',
'parameters' => [
]
]
],
'control_panel' => '<string>',
'addon_ids' => [
'<string>'
],
'accepted_contract_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview"
payload := strings.NewReader("{\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_keys\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"install_management_key\": true,\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"one_click_apps\": [\n {\n \"slug\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"control_panel\": \"<string>\",\n \"addon_ids\": [\n \"<string>\"\n ],\n \"accepted_contract_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_keys\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"install_management_key\": true,\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"one_click_apps\": [\n {\n \"slug\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"control_panel\": \"<string>\",\n \"addon_ids\": [\n \"<string>\"\n ],\n \"accepted_contract_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/organizations/{organization_id}/projects/{project_id}/compute/instances/order-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"size_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"location_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"image_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"\",\n \"volume_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ssh_keys\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"install_management_key\": true,\n \"vpc_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"project_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tags\": [\n \"<string>\"\n ],\n \"one_click_apps\": [\n {\n \"slug\": \"<string>\",\n \"parameters\": {}\n }\n ],\n \"control_panel\": \"<string>\",\n \"addon_ids\": [\n \"<string>\"\n ],\n \"accepted_contract_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Use Authorization: Bearer <token> header. Token can be a JWT token or an API key (format: sk-onetsolutions-...).
Path Parameters
Unique identifier of the organization that owns the resource.
Unique identifier of the project containing the resource.
Body
hourly- hourlymonthly- monthlyquarterly- quarterlysemi_annually- semi_annuallyannually- annuallybiennially- bienniallytriennially- triennially
hourly, monthly, quarterly, semi_annually, annually, biennially, triennially 255Show child attributes
Show child attributes
Slug or id of an active control panel installed after creation
100Paid add-ons to order with the instance, billed on the same order as the instance. Each entry is a size add-on id (available_addons[].id), an add-on id or an add-on slug of the chosen size. A Windows image still requires the Windows Server licence add-on.
20100Contract version ids the customer ticked before ordering
Response
Order preview computed successfully

